package com.example.springbootaccesslimit.controller;

/**
 * @author lxiaol
 * @date 2022年02月09日 22:33
 */

import com.example.springbootaccesslimit.anno.AccessLimit;
import com.example.springbootaccesslimit.entry.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class BookController {

    @AccessLimit(seconds = 5, maxCount = 5)
    @GetMapping("/book")
    public Result<Map<String, String>> book() {
        Map<String, String> map = new HashMap<>();
        map.put("bookName", "hello world");
        map.put("author", "god");
        return Result.success(map);
    }

}
